import Vue from 'vue'
import Router from 'vue-router'
import SystemSet from '@/components/systemSet/systemSet'
import BasicSetup from '@/components/systemSet/basicSetup/basicSetup'
import ServerSetup from '@/components/systemSet/serverSetup/serverSetup'
import campus from '@/components/campus/campus'
import mechanism from '@/components/mechanism/mechanism'
import classes from '@/components/mechanism/classes/classes'
import teacher from '@/components/mechanism/teacher/teacher'
import student from '@/components/mechanism/student/student'
import honor from '@/components/campus/honor/honor'
import SchoolNotice from '@/components/campus/schoolNotice/schoolNotice'
import MoralityAssessment from '@/components/campus/moralityAssessment/moralityAssessment'
import attendance from '@/components/campus/attendance/attendance'
import term from '@/components/mechanism/term/term'

import Home from '@/components/home/home'
import Mine from '@/components/mine/mine'
import ClassAlbum from '@/components/mine/classAlbum/classAlbum'
import ClassInformation from '@/components/mine/classInformation/classInformation'
import timetable from '@/components/mine/timetable/timetable'
import TestScore from '@/components/mine/testScore/testScore'
import Homework from '@/components/mine/homework/homework'
import AttendanceStatistics from '@/components/mine/attendanceStatistics/attendanceStatistics'

import Login from '@/components/login/login'
import Main from '@/components/main'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  base:'/html/',
  routes: [{
    path: '/login',
    name: 'login',
    component: Login
  }, {
    path: '/',
    redirect: {
      name: 'login'
    },
    component: Login
  }, {
    path: '/home',
    redirect: {
      name: 'home'
    },
    component: Main,
    children: [{
        path: '/',
        redirect: {
          name: 'home'
        },
        component: Home
      }, {
        path: '/home',
        name: 'home',
        component: Home
      }, {
        path: '/systemSet',
        name: 'systemSet',
        component: SystemSet,
        children: [{
          path: '/systemSet/',
          redirect: {
            name: 'basicSetup'
          },
          component: BasicSetup
        }, {
          path: '/systemSet/basicSetup',
          name: 'basicSetup',
          component: BasicSetup
        }, {
          path: '/systemSet/serverSetup',
          name: 'serverSetup',
          component: ServerSetup
        }]
      },
      {
        path: '/campus',
        name: 'campus',
        component: campus,
        children: [
          {
          path: '/campus/',
          redirect: {
            name: 'honor'
          },
          component: honor
        },
         {
          path: '/campus/honor',
          name: 'honor',
          component: honor
        }, {
          path: '/campus/schoolNotice',
          name: 'schoolNotice',
          component: SchoolNotice
        }, {
          path: '/campus/moralityAssessment',
          name: 'moralityAssessment',
          component: MoralityAssessment
        }, {
          path: '/campus/attendance',
          name: 'attendance',
          component: attendance
        }]
      },
      {
        path: '/mechanism',
        name: 'mechanism',
        component: mechanism,
        children: [{
          path: '/mechanism/',
          redirect: {
            name: 'teacher'
          },
          component: teacher
        }, {
          path: '/mechanism/classes',
          name: 'classes',
          component: classes
        }, {
          path: '/mechanism/term',
          name: 'term',
          component: term
        }, {
          path: '/mechanism/teacher',
          name: 'teacher',
          component: teacher
        }, {
          path: '/mechanism/student',
          name: 'student',
          component: student
        }]
      }, {
        path: '/mine',
        name: 'mine',
        component: Mine,
        children: [{
          path: '/mine/',
          redirect: {
            name: 'classAlbum'
          },
          component: ClassAlbum
        }, {
          path: '/mine/classAlbum',
          name: 'classAlbum',
          component: ClassAlbum
        },{
          path: '/mine/homework',
          name: 'homework',
          component: Homework
        }, {
          path: '/mine/classInformation',
          name: 'classInformation',
          component: ClassInformation
        }, {
          path: '/mine/timetable',
          name: 'timetable',
          component: timetable
        }, {
          path: '/mine/testScore',
          name: 'testScore',
          component: TestScore
        }, {
          path: '/mine/attendanceStatistics',
          name: 'attendanceStatistics',
          component: AttendanceStatistics
        }]
      },
    ]
  }]
})
